import chomsky.Reader;
import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author Anarcaster
 */
public class Main {

    static final private String USERNAME = "alberto.lumbreras@gmail.com";
    static final private String PASSWORD = "uila9ueucabi";
    static final private String FOLDERNAME = "Comunidad";

    static final private String IMAP_HOST = "imap.gmail.com";
    static final private String IMAP_PORT = "993";
    static final private String IMAP_CONNECTIONTIMEOUT = "5000";
    static final private String IMAP_TIMEOUT = "5000";

    public static void main(String[] args) throws IOException {


        //Preparo los parámetros de conexión al servidor
        Properties connectionParams = new Properties();
        connectionParams.setProperty("mail.imap.username", USERNAME);
        connectionParams.setProperty("mail.imap.password", PASSWORD);
        connectionParams.setProperty("mail.imap.folder", FOLDERNAME);

        connectionParams.setProperty("mail.imap.host", IMAP_HOST);
        connectionParams.setProperty("mail.imap.port", IMAP_PORT);
        connectionParams.setProperty("mail.imap.connectiontimeout", IMAP_CONNECTIONTIMEOUT);
        connectionParams.setProperty("mail.imap.timeout", IMAP_TIMEOUT);

        //Objeto que se conecta y extrae los mails
        Reader reader = new Reader();
        reader.getMails(connectionParams);
    }

}
